﻿#region Using Statements

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
using MilwormsGameData;
using MilwormsGameContentPipeline;


#endregion

namespace MilwormsGameContentPipeline
{
    [ContentTypeWriter]
    public class QuestNpcWriter : MilwormsGameWriter<QuestNpc>
    {
        CharacterWriter characterWriter = null;

        protected override void Initialize(ContentCompiler compiler)
        {
            characterWriter = compiler.GetTypeWriter(typeof(Character))
                as CharacterWriter;

            base.Initialize(compiler);
        }

        protected override void Write(ContentWriter output, QuestNpc value)
        {
            output.WriteRawObject<Character>(value as Character, characterWriter);
            output.Write(value.Introduction);
            output.WriteObject(value.Dialogs);
        }

        public override string GetRuntimeType(TargetPlatform targetPlatform)
        {
            return typeof(MilwormsGameData.QuestNpc).AssemblyQualifiedName;
        }

        public override string GetRuntimeReader(TargetPlatform targetPlatform)
        {
            return typeof(MilwormsGameData.QuestNpc.QuestNpcReader).AssemblyQualifiedName;
        }
    }
}
